Database systems are susceptible to failure for a variety of reasons including both software and hardware related issues. As a result, recovery logs that record various operations performed by such database systems have been adopted. These recovery logs record various actions performed by the database systems which can be later replayed, if needed, as part of a recovery operation. Further, as part of such recovery, certain operations which have not been fully executed can be reverted or, if fully executed, might clean up or reorganize the data space. Such cleanup or undo operations are written to cleanup and undo log respectively during the execution of such operations. The execution of cleanup log is typically called ‘garbage collection’.